/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bm.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author Mirza at Bimasakti
 */
public class MrStringUtil {

    public static String convertDate(String date) {
        String startDateString = date;
        DateFormat df = new SimpleDateFormat("yy-MM-dd HH:mm:ss");
        Date startDate;
        try {
            startDate = df.parse(startDateString);

            DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            String newDateString = df2.format(startDate);
            
            return newDateString;
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}
